package com.company.clientscard.server.service;

import java.util.Date;
import java.util.List;

import org.springframework.context.ApplicationContext;

import com.company.clientscard.server.domain.Document;

public class DocumentController {
	private static ApplicationContext context;
	private static DocumentService service;

	public DocumentController() {
		context = Context.getContext();
		service = (DocumentService) context.getBean(DocumentService.class);
	}

	public void save(Document object) {
		service.save(object);
	}

	public Document findById(Long id) {
		return service.findById(id);
	}

	public Document update(Document object) {
		return service.update(object);
	}

	public List<Document> findAll() {
		return service.findAll(Document.class);
	}

	public List<Document> findWithExpression(int firstRow, int numberOfRows,
			Date date1, Date date2) {
		return service.findWithExpression(Document.class, firstRow,
				numberOfRows, date1, date2);
	}

	public List<Document> findWithParam(String paramName, Object param) {
		return service.findWithParam(Document.class, paramName, param);
	}
}
